Using the post method to send data to server